<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Kefu extends MY_Controller {

	public $left_menu_min;

	function __construct(){
		parent::__construct();
		$this->left_menu_min = array("menu" => "网校设置", "curr" => '/kefu', "list" => array("学校设置" => "/school", "学校资讯" => "/news", "帮助中心" => "/help", "友情连接" => "/friend_link", "网点管理" => "/wangdian", "问答管理" => "/question_topic", "客服设置" => "/kefu"));
		$this->smarty->assign("left_menu_min", $this->left_menu_min);
		$this->smarty->assign("menu", 'school');
	}

	function index($title = 0, $limit = 0){
		if($_POST){
			$post_data = $this->input->post();
			$this->db->where("id", $this->user_data['school_id']);
			$this->db->update("o2o_school", $post_data);
			show_message("/kefu", "保存成功");exit;
		}
		$info = get_field_by_where("o2o_school", "qq1,qq2,qq3,qq4", "id='{$this->user_data['school_id']}'");
		$this->smarty->assign("info", $info);
		$this->smarty->display("kefu/qq.html");
	}

	function bdsq(){
		if($_POST){
			$post_data = $this->input->post();
			$this->db->where("id", $this->user_data['school_id']);
			$this->db->update("o2o_school", $post_data);
			show_message("/kefu/bdsq", "保存成功");exit;
		}
		$info = get_field_by_where("o2o_school", "bdsq", "id='{$this->user_data['school_id']}'");
		$this->smarty->assign("info", $info);
		$this->smarty->display("kefu/bdsq.html");
	}

}